import request from '@/config/axios'

export interface SoftwareVersionVO {
  id: number
  status: number
  apkMd5: string
  apkSize: number
  downloadUrl: string
  modifyContent: string
  updateStatus: string
  versionCode: string
  versionName: string
  softwareType: string
  schoolId: number
  schoolName: string
  platformId: string
}

// 查询系统软件版本列表
export const getSoftwareVersionPage = async (params) => {
  return await request.get({ url: '/system/software-version/page', params })
}

// 查询系统软件版本详情
export const getSoftwareVersion = async (id: number) => {
  return await request.get({ url: '/system/software-version/get?id=' + id })
}

// 新增系统软件版本
export const createSoftwareVersion = async (data: SoftwareVersionVO) => {
  return await request.post({ url: '/system/software-version/create', data })
}

// 修改系统软件版本
export const updateSoftwareVersion = async (data: SoftwareVersionVO) => {
  return await request.put({ url: '/system/software-version/update', data })
}

// 删除系统软件版本
export const deleteSoftwareVersion = async (id: number) => {
  return await request.delete({ url: '/system/software-version/delete?id=' + id })
}

// 导出系统软件版本 Excel
export const exportSoftwareVersion = async (params) => {
  return await request.download({ url: '/system/software-version/export-excel', params })
}
